import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
Vue.use(Router)

export default new Router({
    routes: [{
        path: '/h',
        name: 'HelloWorld',
        component: HelloWorld
    }, {
        path: '/login',
        name: 'Login',
        component: Login
    }, {
        path: '/',
        name: 'Index',
        component: Index,
        children: [{
                path: '/page1',
                name: 'page1',
                component: function() {
                    return import ('../components/Page1.vue')
                },

            },
            {
                path: '/page2',
                name: 'page2',
                component: function() {
                    return import ('../components/Page2.vue')
                }
            },
            {
                path: '/roles',
                name: 'roles',
                component: function() {
                    return import ('../components/Roles.vue')
                }
            }
        ]
    }]
})